package builder_mode

type CarBuilder struct {
	car *Car
}

func (c *CarBuilder) SetName(name string) Builder {
	if c.car == nil {
		c.car = &Car{}
	}
	c.car.SetName(name)
	return c
}

func (c *CarBuilder) SetColor(color string) Builder {
	if c.car == nil {
		c.car = &Car{}
	}
	c.car.SetColor(color)
	return c
}

func (c *CarBuilder) Build() *Car {
	return c.car
}
